function vtk3d_psi
  
  jx = 128; jy = 128; jz = 128;

  fname = 'g2_a1.psi.';

for fnum = 1:63

  fn = num2str(fnum,'%04d');


  [ fname , fn ]
  fid = fopen([fname, fn], 'rb');
  v = fread(fid, [2 jx*jy*jz], 'double');
  fclose(fid);

  re = reshape(v(1,:), jz,jy,jx);
  im = reshape(v(2,:), jz,jy,jx);
  re  = flipxz(re);
  im  = flipxz(im);

  ab = sqrt(re.^2+im.^2);

  vtk3d_any(re, 'psi_re', [fname, fn,  '.re.vtk']);
  vtk3d_any(im, 'psi_im', [fname, fn, '.im.vtk']);
  vtk3d_any(ab, 'psi_abs', [fname, fn, '.abs.vtk']);
  end

end

function fv = flipxz(v)

  [jz,jy,jx] = size(v);
  fv = zeros(jx,jy,jz);

  for j=1:jy
    a = v(:,j,:);
    a = reshape(a, jz, jx);
    fv(:,j,:) = a';
  end

end
